#ifndef GRIDWIDGET_H
#define GRIDWIDGET_H
#include <QObject>
#include <QtGui>
#include <QtDebug>
#include "thumbnail.h"
#define MAX_BOOKMARKS 1000


class GridWidget : public QWidget
{
    Q_OBJECT
public:
    static GridWidget* getInstance()
    {
        static GridWidget* inst =0;
        if(inst) return inst;
        else
        {
            return (inst= new GridWidget());
        }
    }

    //QSize sizeHint() const;
    void resizeEvent(QResizeEvent *event);
    void displayList(QList<QTreeWidgetItem*>& list);
    void removeAllWidgets();
    void putNWidgets(int no);
    Thumbnail* getSelected() {return currentSelected;}
    void setNoWidgets(int n)

    {
        numWidgets = n;
    }

public slots:
    void selectedItem();

private:
    int numWidgets;
    GridWidget();
    void createWidget();
    //Layout
    QGridLayout* grid;
    QList<Thumbnail*> thumbs;
    Thumbnail* currentSelected;

};

#endif // GRIDWIDGET_H
